#ifndef RANDOM_H
#define RANDOM_H

#include "gsl/gsl_randist.h"

class Random
{
public:
    static gsl_rng* randomNumberGenerator;

    static gsl_rng* getGenerator(int seed = 1)
    {
        if(randomNumberGenerator)
        {
            gsl_rng_set(randomNumberGenerator, seed);
            return randomNumberGenerator;
        }

        randomNumberGenerator = gsl_rng_alloc(gsl_rng_ranlxd2);
        gsl_rng_set(randomNumberGenerator, seed);

        return randomNumberGenerator;
    }

};

gsl_rng* Random::randomNumberGenerator = 0;

#endif // RANDOM_H
